<!doctype html>
<html lang="en">
	<head>
		<meta charset="utf-8" />
		<title>品种管理</title>
		<link href="../css/bootstrap.min.css" rel="stylesheet" />
		<link href="../css/material-dashboard.css" rel="stylesheet" />
		<script src="../js/jquery-3.2.1.min.js"></script>
		<style>
			.form-control1 {
				width: 70%;
				height: 34px;
				font-size: 14px;
				line-height: 1.42857143;
				color: #555555;
				background-color: #fff;
				background-image: none;
				border: 1px solid #ccc;
				border-radius: 4px;
				transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s, -webkit-box-shadow ease-in-out .15s;
			}

			.form-control1:focus {
				border-color: #66afe9;
				outline: 0;
				-webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075), 0 0 8px rgba(102, 175, 233, 0.6);
				box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075), 0 0 8px rgba(102, 175, 233, 0.6);
			}

			.sidebar[data-color="purple"] .nav li.active a,
			.off-canvas-sidebar[data-color="purple"] .nav li.active a {
				background-color: #0c8687;
				box-shadow: 0 12px 20px -10px rgba(0, 190, 139, 0.3), 0 4px 20px 0px rgba(0, 208, 153, 0.1), 0 7px 8px -5px rgba(0, 153, 112, 0.2);
			}

			.modal-body button {
				width: 100px;
				height: 100px;
				border-radius: 50%;
				margin: 20px;
			}

			.aui-info {
				position: relative;
				width: 400px;
				height: auto;
				text-align: center;
				margin: 0 auto;
			}

			.aui-img-round {
				width: 100px;
				height: 100px;
				border-radius: 50%;
				border: 1px #ccc solid;
			}

			.fileInput {
				width: 6.25rem;
				height: 100px;
				position: absolute;
				top: 0;
				/* bottom: 300px; */
				left: 0;
				right: 0;
				opacity: 0;
				display: block;
				width: 100px;
				clear: both;
				display: block;
				margin: auto;
				background-color: red;
			}

			.info1 {
				width: 500px;
				margin-top: 15px;
				height: 180px;
				text-align: center;
			}

			.info1 div {
				float: left;
				width: 250px;
				height: 60px;
			}

			.info2 {
				height: 300px;
			}

			.info3 {
				width: 500px;
				margin-top: 15px;
				height: 315px;
				text-align: center;
			}

			.info3>div {
				float: left;
				width: 230px;
				height: 60px;
				text-align: left;
				margin-left: 20px;
			}

			.info3>div>input {
				width: 30px;
				height: 26px;
				text-align: center;
				border: none;
			}

			.progress {
				width: 200px;
				height: 24px;
			}
		</style>
		<style>
			/* 分页 */
			.page-container a,
			.page-container a:hover {
				color: #0c8687;
				font-size: 14px;
				text-decoration: none;
			}

			.pagination>.active>a,
			.pagination>.active>span,
			.pagination>.active>a:hover,
			.pagination>.active>span:hover,
			.pagination>.active>a:focus,
			.pagination>.active>span:focus {
				z-index: 3;
				color: #fff;
				cursor: default;
				background-color: #0c8687;
				border-color: #0c8687;
			}

			.pagination>li>a {
				color: rgb(187, 187, 187);
			}

			.pagination input {
				outline: none;
				border-radius: 4px;
				width: 60px;
				height: 34px;
				outline: none;
				border: 1px #DDDDDD solid;
				text-align: center;
			}

			#go-page {
				border: 1px #0c8687 solid;
				color: #fff;
				background: #0c8687;
			}

			/* 表格 */
			.tablelist {
				width: 100%;
				height: auto;
				/* border: 1px #0c8687 solid; */
				margin-top: 70px;
			}

			.table-user {
				width: 90%;
				border-collapse: collapse;
				margin: 0 auto;
			}

			.table-user caption {
				/* font-size: 2em; */
				font-weight: bold;
				/* margin: 1em 0; */
			}

			.table-user caption div {
				float: right;
			}

			.table-user caption input {
				width: 260px;
				height: 36px;
				color: #0c8687;
				border: 1px #0c8687 solid;
				border-radius: 5px;
			}

			th,
			td {
				border: 1px solid #ddddddc9;
				text-align: center;
				/* padding: 10px 0; */
			}

			.table-user thead tr {
				background-color: #008c8c;
				color: #fff;
			}

			.table-user thead tr th {
				padding: 10px 0;
			}

			.table-user tbody tr:nth-child(odd) {
				background-color: #eee;
			}

			.table-user tbody tr:hover {
				background-color: #0c868773;
			}

			.table-user tbody tr td:first-child {
				color: #0c8687;
			}

			.table-user tbody tr td:last-child {
				width: 230px;
			}

			.table-user tbody tr td button {
				margin: 0 10px;
				outline: none;
			}

			.table-user tfoot tr td {
				text-align: right;
				padding-right: 20px;
				border: none;
			}

			caption select {
				width: 170px;
				height: 35px;
				border: 1px #0c8687 solid;
				border-radius: 5px;
				color: #0c8687;
				margin-top: 5px;
			}

			caption button {
				width: 80px;
				height: 36px;
				background-color: #0c8687;
				border: none;
				border-radius: 5px;
				color: #fff;
			}
		</style>
	</head>
	<body>
		<!-- 模态框（Modal1） -->
		<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"
			aria-hidden="true">
			<div class="modal-dialog">
				<div class="modal-content">
					<div class="modal-header" style="border-bottom: 2px #ddd solid;">
						<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
						<h4 class="modal-title" id="messagetitle" data-toggle="modal" data-target="#messageBox">显示
						</h4>
					</div>
					<div class="modal-body" style="text-align: center;">
						<form name="saveMessage">
							<button class="btn btn-info" data-dismiss="modal">个人资料</button>
							<button class="btn btn-danger" id="over">退出</button>
						</form>
					</div>
					<div class="modal-footer">
						<button type="button" class="btn-flat pull-right close-notice btn btn-default"
							style="margin-right: 20px;" data-dismiss="modal">关闭</button>
					</div>
				</div><!-- /.modal-content -->
			</div><!-- /.modal -->
		</div>

		<!-- 模态框（Modal2）   个人资料显示 -->
		<div class="modal fade" id="myModal2" tabindex="-1" role="dialog" aria-labelledby="gridSystemModalLabel">
			<div class="modal-dialog" role="document">
				<div class="modal-content">
					<div class="modal-header">
						<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
								aria-hidden="true">&times;</span></button>
						<h4 class="modal-title" id="gridSystemModalLabel">资料显示</h4>
					</div>
					<div class="modal-body">
						<form action="#" method="post" enctype="multipart/form-data">
							<div class="aui-info">
								<img src="../images/6.jpg" id="img-txz"
									style="width: 100px;height: 100px;border-radius: 50%;"
									class="aui-img-round user-img" />
								<input type="file" accept="image/*" id="file-txz" name="file"
									onchange="upload('#file-txz', '#img-txz');" class="fileInput" value="" />
							</div>
							<div class="aui-info info1">
								<div>
									<span>用户名：<input type="text" id="username" class="form-control1"
											value="柠檬" /></span>
								</div>
								<div>
									<span>性别：<input type="text" id="sex" class="form-control1" value="女" /></span>
								</div>
								<div>
									<span>邮箱：<input type="text" id='email' class="form-control1"
											value="123@qq.com" /></span>
								</div>
								<div>
									<span>手机号码：<input type="text" id="phone" class="form-control1"
											value="17375212967" /></span>
								</div>
								<div>
									<span>生日：<input type="text" id="born" class="form-control1"
											value="2002-11-11" /></span>
								</div>
								<div>
									<span class="has-success">地址：<input type="text" id="adrs"
											class="form-control1 input-success" value="湖南省长沙市开福区" /></span>
								</div>

							</div>
						</form>

					</div>
					<div class="modal-footer">
						<button type="button" class="btn btn-default" data-dismiss="modal"
							style="width: 90px;">取消</button>
						<button type="button" class="btn btn-primary update" style="width: 90px;">修改</button>
					</div>
				</div><!-- /.modal-content -->
			</div><!-- /.modal-dialog -->
		</div><!-- /.modal -->
		<!-- 模态框（Modal3）   添加宠物品种-->
		<div class="modal fade" id="myModal3" tabindex="-1" role="dialog" aria-labelledby="gridSystemModalLabel">
			<div class="modal-dialog" role="document">
				<div class="modal-content">
					<div class="modal-header">
						<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
								aria-hidden="true">&times;</span></button>
						<h4 class="modal-title" id="gridSystemModalLabel">添加宠物品种</h4>
					</div>
					<div class="modal-body">
						<form action="#" onsubmit="return false" method="post" enctype="multipart/form-data">
							<div class="aui-info">
								<img src="../images/pet-avatar.png" id="img-tj" class="aui-img-round user-img" />
								<input type="file" accept="image/*" id="file-tj" name="file"
									onchange="upload('#file-tj', '#img-tj');" class="fileInput" value="" />
							</div>

							<div class="aui-info info1 info2">
								<div>
									<span>品种名称：<input type="text" id="pzmc" class="form-control1" value="" /></span>
								</div>
								<div>
									<span>类型：
										<select id="types1" class="form-control1">
											<option value="0">请选择</option>
											<option value="1">猫</option>
											<option value="2">狗</option>
										</select>
									</span>
								</div>
								<div>
									<span>别名：<input type="text" id="nick" class="form-control1" value="" /></span>
								</div>
								<div>
									<span>原产地：<input type="text" id='ycd' class="form-control1" value="" /></span>
								</div>
								<div>
									<span>毛长：<input type="text" id="mc" class="form-control1" value="" /></span>
								</div>
								<div>
									<span>体型：<input type="text" id="tx" class="form-control1" /></span>
								</div>
								<div>
									<span>身高：<input type="text" id="sg" class="form-control1" /></span>
								</div>
								<div>
									<span>体重：<input type="text" id="tz" class="form-control1" /></span>
								</div>
								<div>
									<span>寿命：<input type="text" id="sm" class="form-control1" /></span>
								</div>
								<div>
									<span>智商排名：<input type="text" id="iq" class="form-control1" /></span>
								</div>
							</div>
							<!-- <div class="aui-info"
								style="width: 500px;height: 105px;position: relative;text-align: right;">
								<span style="position: absolute;top: 10px;left: 0;">特征描述：</span>
								<textarea style="width: 86%;height: 70px;" class="form-control1"></textarea>

							</div>
							<div class="aui-info" style="width: 500px;position: relative;text-align: right;">
								<span style="position: absolute;top: 10px;left: 0;">喂养方法：</span>
								<textarea style="width: 86%;height: 70px;" class="form-control1"></textarea>
							</div> -->
						</form>

					</div>
					<div class="modal-footer">
						<button type="button" class="btn btn-default" data-dismiss="modal"
							style="width: 90px;">取消</button>
						<button type="button" class="btn btn-success addpet" style="width: 90px;">添加</button>
					</div>
				</div><!-- /.modal-content -->
			</div><!-- /.modal-dialog -->
		</div><!-- /.modal -->
		<!-- 模态框（Modal4）   修改查看品种-->
		<div class="modal fade" id="myModal4" tabindex="-1" role="dialog" aria-labelledby="gridSystemModalLabel">
			<div class="modal-dialog" role="document">
				<div class="modal-content">
					<div class="modal-header">
						<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
								aria-hidden="true">&times;</span></button>
						<h4 class="modal-title" id="gridSystemModalLabel">修改宠物品种</h4>
					</div>
					<div class="modal-body">
						<form action="#" method="post" enctype="multipart/form-data">
							<div class="aui-info">
								<img src="../images/pet-avatar.png" id="img-xgpz" class="aui-img-round user-img" />
								<input type="file" accept="image/*" id="file-xgpz" name="file"
									onchange="upload('#file-xgpz', '#img-xgpz');" class="fileInput" value="" />
							</div>

							<div class="aui-info info1 info2">
								<div>
									<span>品种名称：<input type="text" id="bname1" class="form-control1" value="" /></span>
								</div>
								<div>
									<span>类型：
										<select id="types2" class="form-control1">
											<option value="0">请选择</option>
											<option value="1">猫</option>
											<option value="2">狗</option>
										</select>
									</span>
								</div>
								<div>
									<span>别名：<input type="text" id="nick1" class="form-control1" value="" /></span>
								</div>
								<div>
									<span>原产地：<input type="text" id='ycd1' class="form-control1" value="" /></span>
								</div>
								<div>
									<span>毛长：<input type="text" id="mc1" class="form-control1" value="" /></span>
								</div>
								<div>
									<span>体型：<input type="text" id="tx1" class="form-control1" value="" /></span>
								</div>
								<div>
									<span>身高：<input type="text" id="sg1" class="form-control1"
											value="" /></span>
								</div>
								<div>
									<span>体重：<input type="text" id="tz1" class="form-control1"
											value="" /></span>
								</div>
								<div>
									<span>寿命：<input type="text" id="sm1" class="form-control1" value="" /></span>
								</div>
								<div>
									<span>智商排名：<input type="text" id="iq1" class="form-control1"
											value="" /></span>
								</div>
							</div>
						</form>
					</div>
					<div class="modal-footer">
						<button type="button" class="btn btn-default" data-dismiss="modal"
							style="width: 90px;">取消</button>
						<button type="button" class="btn btn-primary updatepetpz" style="width: 90px;">修改</button>
					</div>
				</div><!-- /.modal-content -->
			</div><!-- /.modal-dialog -->
		</div><!-- /.modal -->

		<!-- 模态框（Modal2）   评分显示 -->
		<div class="modal fade" id="myModal5" tabindex="-1" role="dialog" aria-labelledby="gridSystemModalLabel">
			<div class="modal-dialog" role="document">
				<div class="modal-content">
					<div class="modal-header">
						<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
								aria-hidden="true">&times;</span></button>
						<h4 class="modal-title" id="gridSystemModalLabel">评分显示<span
								class="label label-danger label-sm wpf" style="display: none;">未评分</span></h4>
					</div>
					<div class="modal-body">
						<form action="#" method="post" enctype="multipart/form-data">
							<div class="aui-info info3">
								<div>
									粘人程度：<input class="form-control1 score" type="tel" id="nr" value="" />
									<div class="progress">
										<div class="progress-bar progress-bar-success" role="progressbar"
											aria-valuenow="40" aria-valuemin="0" aria-valuemax="100" style="width: 0%">
										</div>
									</div>
								</div>
								<div>
									喜叫程度：<input class="form-control1 score" type="tel" id="xj" value="" />
									<div class="progress">
										<div class="progress-bar progress-bar-success" role="progressbar"
											aria-valuenow="40" aria-valuemin="0" aria-valuemax="100" style="width: 0%">
										</div>
									</div>
								</div>
								<div>
									友善程度：<input class="form-control1 score" type="tel" id="ys" value="" />
									<div class="progress">
										<div class="progress-bar progress-bar-success" role="progressbar"
											aria-valuenow="40" aria-valuemin="0" aria-valuemax="100" style="width: 0%">
										</div>
									</div>
								</div>
								<div>
									掉毛程度：<input class="form-control1 score" type="tel" id="dm" value="" />
									<div class="progress">
										<div class="progress-bar progress-bar-success" role="progressbar"
											aria-valuenow="40" aria-valuemin="0" aria-valuemax="100" style="width: 0%">
										</div>
									</div>
								</div>
								<div>
									美容程度：<input class="form-control1 score" type="tel" id="mr" value="" />
									<div class="progress">
										<div class="progress-bar progress-bar-success" role="progressbar"
											aria-valuenow="40" aria-valuemin="0" aria-valuemax="100" style="width: 0%">
										</div>
									</div>
								</div>
								<div>
									体味程度：<input class="form-control1 score" type="tel" id="tw" value="" />
									<div class="progress">
										<div class="progress-bar progress-bar-success" role="progressbar"
											aria-valuenow="40" aria-valuemin="0" aria-valuemax="100" style="width: 0%">
										</div>
									</div>
								</div>
								<div>
									口水程度：<input class="form-control1 score" type="tel" id="ks" value="" />
									<div class="progress">
										<div class="progress-bar progress-bar-success" role="progressbar"
											aria-valuenow="40" aria-valuemin="0" aria-valuemax="100" style="width: 0%">
										</div>
									</div>
								</div>
								<div>
									可训程度：<input class="form-control1 score" type="tel" id="kx" value="" />
									<div class="progress">
										<div class="progress-bar progress-bar-success" role="progressbar"
											aria-valuenow="40" aria-valuemin="0" aria-valuemax="100" style="width: 0%">
										</div>
									</div>
								</div>
								<div>
									活跃程度：<input class="form-control1 score" type="tel" id="hy" value="" />
									<div class="progress">
										<div class="progress-bar progress-bar-success" role="progressbar"
											aria-valuenow="40" aria-valuemin="0" aria-valuemax="100" style="width: 0%">
										</div>
									</div>
								</div>
							</div>
						</form>

					</div>
					<div class="modal-footer">
						<button type="button" class="btn btn-default quxiao" data-dismiss="modal"
							style="width: 90px;">取消</button>
						<button type="button" class="btn btn-primary updatescore" style="width: 90px;">修改</button>
					</div>
				</div><!-- /.modal-content -->
			</div><!-- /.modal-dialog -->
		</div><!-- /.modal -->

		<!-- 模态框（Modal2）   添加评分 -->
		<div class="modal fade" id="myModal6" tabindex="-1" role="dialog" aria-labelledby="gridSystemModalLabel">
			<div class="modal-dialog" role="document">
				<div class="modal-content">
					<div class="modal-header">
						<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
								aria-hidden="true">&times;</span></button>
						<h4 class="modal-title" id="gridSystemModalLabel">添加评分</h4>
					</div>
					<div class="modal-body">
						<form action="#" onsubmit="return false" method="post" enctype="multipart/form-data">
							<div class="aui-info info3">
								<div>
									粘人程度：<input class="form-control1 score" type="tel" id="nr1" value="0" />
									<div class="progress">
										<div class="progress-bar progress-bar-success" role="progressbar"
											aria-valuenow="40" aria-valuemin="0" aria-valuemax="100" style="width: 0%">
										</div>
									</div>
								</div>
								<div>
									喜叫程度：<input class="form-control1 score" type="tel" id="xj1" value="0" />
									<div class="progress">
										<div class="progress-bar progress-bar-success" role="progressbar"
											aria-valuenow="40" aria-valuemin="0" aria-valuemax="100" style="width: 0%">
										</div>
									</div>
								</div>
								<div>
									友善程度：<input class="form-control1 score" type="tel" id="ys1" value="0" />
									<div class="progress">
										<div class="progress-bar progress-bar-success" role="progressbar"
											aria-valuenow="40" aria-valuemin="0" aria-valuemax="100" style="width: 0%">
										</div>
									</div>
								</div>
								<div>
									掉毛程度：<input class="form-control1 score" type="tel" id="dm1" value="0" />
									<div class="progress">
										<div class="progress-bar progress-bar-success" role="progressbar"
											aria-valuenow="40" aria-valuemin="0" aria-valuemax="100" style="width: 0%">
										</div>
									</div>
								</div>
								<div>
									美容程度：<input class="form-control1 score" type="tel" id="mr1" value="0" />
									<div class="progress">
										<div class="progress-bar progress-bar-success" role="progressbar"
											aria-valuenow="40" aria-valuemin="0" aria-valuemax="100" style="width: 0%">
										</div>
									</div>
								</div>
								<div>
									体味程度：<input class="form-control1 score" type="tel" id="tw1" value="0" />
									<div class="progress">
										<div class="progress-bar progress-bar-success" role="progressbar"
											aria-valuenow="40" aria-valuemin="0" aria-valuemax="100" style="width: 0%">
										</div>
									</div>
								</div>
								<div>
									口水程度：<input class="form-control1 score" type="tel" id="ks1" value="0" />
									<div class="progress">
										<div class="progress-bar progress-bar-success" role="progressbar"
											aria-valuenow="40" aria-valuemin="0" aria-valuemax="100" style="width: 0%">
										</div>
									</div>
								</div>
								<div>
									可训程度：<input class="form-control1 score" type="tel" id="kx1" value="0" />
									<div class="progress">
										<div class="progress-bar progress-bar-success" role="progressbar"
											aria-valuenow="40" aria-valuemin="0" aria-valuemax="100" style="width: 0">
										</div>
									</div>
								</div>
								<div>
									活跃程度：<input class="form-control1 score" type="tel" id="hd1" value="0" />
									<div class="progress">
										<div class="progress-bar progress-bar-success" role="progressbar"
											aria-valuenow="40" aria-valuemin="0" aria-valuemax="100" style="width: 0%">
										</div>
									</div>
								</div>
							</div>
						</form>

					</div>
					<div class="modal-footer">
						<button type="button" class="btn btn-default" data-dismiss="modal"
							style="width: 90px;">取消</button>
						<button type="button" class="btn btn-success addscore" style="width: 90px;">添加</button>
					</div>
				</div><!-- /.modal-content -->
			</div><!-- /.modal-dialog -->
		</div><!-- /.modal -->





		<div class="wrapper">

			<div class="sidebar" data-color="purple" data-image="../assets/img/sidebar-1.jpg">
				<div class="logo" style="background-color: #0c8687;width: 260px;height: 70px;">
					<a href="#" class="simple-text" style="color: #fff;">
						<img src="../images/logo-pet2.png" style="position: absolute;top: -60px;left: 0px;"/>
					</a>
				</div>
				<div class="sidebar-wrapper">
					<ul class="nav">
						<li>
							<a href="usermanager.html">
								<p>用户管理</p>
							</a>
						</li>
						<li class="active">
							<a href="adminpetbrand.html">
								<p>品种管理</p>
							</a>
						</li>
						<li>
							<a href="petinfo.html">
								<p>信息管理</p>
							</a>
						</li>
						<li>
							<a href="finder.html">
								<p>寻宠、招领管理</p>
							</a>
						</li>
						<li>
							<a href="bbscomment.html">
								<p>论坛、评论管理</p>
							</a>
						</li>
						<li>
							<a href="fostercare.html">

								<p>领养、寄养管理</p>
							</a>
						</li>

					</ul>
				</div>
			</div>

			<div class="main-panel">
				<nav class="navbar navbar-transparent navbar-absolute" style="background-color: #0c8687;height: 70px;">
					<div class="container-fluid">
						<div class="collapse navbar-collapse">
							<ul class="nav navbar-nav navbar-right">
								<li>
									<button class="btn btn-default" data-toggle="modal" data-target="#myModal"
										style="width: 56px;height: 56px;border-radius: 50%;position: relative;background-color: #fff;">
										<img src="../images/c1.jpg" class="img-tx"
											style="width: 56px;height: 56px;border: 1px #fff solid;border-radius: 50%;position: absolute;top: 0px;right: 2px;" />
									</button>
								</li>
							</ul>
						</div>
					</div>
				</nav>
				<div class="tablelist">
					<table class="table-user">
						<caption>
							<div style="float: left;">
								<select class="form-select" name="types" id="pettype">
									<option value="0" selected>请选择宠物类型</option>
									<option value="1">猫</option>
									<option value="2">狗</option>
								</select>
								<button class="btn btn-success" style="line-height: 15px;" data-toggle="modal"
									data-target="#myModal3">添加</button>
							</div>
							<div>
								<input type="text" class="input-success bname" />
								<button class="ser-pet cxpet">查询</button>
							</div>
						</caption>
						<thead>
							<tr>
								<th>宠物编号</th>
								<th>宠物图片</th>
								<th>品种名称</th>
								<th>别名</th>
								<th>原产地</th>
								<th>寿命</th>
								<th>品种类型</th>
								<th>评分</th>
								<th>操作</th>
							</tr>
						</thead>
						<tbody class="petinfo">
							<!-- <tr>
								<td>7</td>
								<td><img src="../images/6.jpg" width="45px" /></td>
								<td>柠檬</td>
								<td>小檬</td>
								<td>非洲</td>
								<td>10年</td>
								<td>猫</td>
								<td style="width: 230px;">
									<button class="btn btn-info btn-sm" data-toggle="modal"
										data-target="#myModal5">查看</button>
									<button class="btn btn-success btn-sm" data-toggle="modal"
										data-target="#myModal6">添加</button>
								</td>
								<td>
									<button class="btn btn-info btn-sm" data-toggle="modal"
										data-target="#myModal4">详情</button>
									<button class="btn btn-danger btn-sm deladmin">删除</button>
								</td>
							</tr> -->
						</tbody>


						<tfoot>
							<tr>
								<td colspan="10">
									<div class="text-center hidden-xs" style="margin-left: 256px;text-align: right;">
										<ul class="pagination">
											<li class="active"><a href="javascript:void(0)" id="firstpage"
													title="首页">首页</a></li>
											<li><a href="javascript:void(0)" id="prevpage" title="上一页">上一页</a></li>
											<li><a href="javascript:void(0)" id="nextpage" title="下一页">下一页</a></li>
											<li><a href="javascript:void(0)" id="lastpage" title="最后一页">尾页</a></li>
											<li style="margin-left: 20px;">第<input type="text" id="pagenum"
													value="1" />页
												<input type="button" value="GO" id="go-page" style="" />
											</li>
										</ul>
									</div>
								</td>
							</tr>
						</tfoot>
					</table>
				</div>

			</div>

	</body>

	<!--   Core JS Files   -->
	<script src="../js/jquery-3.1.0.min.js" type="text/javascript"></script>
	<script src="../js/bootstrap.min.js" type="text/javascript"></script>
	<script src="../js/material.min.js" type="text/javascript"></script>
	<script src="../js/chartist.min.js"></script>
	<script src="../js/material-dashboard.js"></script>
	<script type="text/javascript" src="../js/plugs.js">
	</script>
	
	<script type="text/javascript">
		$(function() {
			
		})
	</script>
	<!-- 修改用户  验证  注销-->
	<script>
		$(function() {
			$('#myModal').on('hidden.bs.modal', function() {
				//模态框关闭时执行
				$("#myModal2").modal('show');
			});
			//注销
			$("#over").click(function(event) {
				event.preventDefault();
				if (!confirm("是否确定退出后台？")) {
					return;
				}
				$.post('http://localhost:80/ct/overuser', function(r) {
					if (r) {
						location.href = 'login.html';
					}
				}, "json");
			
			})	
			//显示管理员信息
			admininfo();
	
			function admininfo() {
				$.post('http://localhost:80/ct/admindetail', function(r) {
					$(".img-tx").attr("src", "../images/" + r.filename + "");
					$("#img-txz").attr("src", "../images/" + r.filename + "");
					$("#username").val(r.username);
					$("#sex").val(r.sex);
					$("#phone").val(r.phone);
					$("#born").val(r.borndate);
					$("#adrs").val(r.faddress);
					$("#email").val(r.email);
				}, "json");
			}
	
			//修改管理员信息
			$(".update").click(function() {
				let user = $("#username").val();
				let sex = $("#sex").val();
				let phone = $("#phone").val();
				let adrs = $("#adrs").val();
				let born = $("#born").val();
				let email = $("#email").val();
				//非空验证
				if (user == '' || sex == '' || born == '' || phone == '' || adrs == '' || email == '') {
					if (user == '') {
						$("#username").css("border-color", "#a94442").css("box-shadow",
							"inset 0 1px 1px rgba(0,0,0,.075)");
					}
					if (sex == '') {
						$("#sex").css("border-color", "#a94442").css("box-shadow",
							"inset 0 1px 1px rgba(0,0,0,.075)");
					}
					if (born == '') {
						$("#born").css("border-color", "#a94442").css("box-shadow",
							"inset 0 1px 1px rgba(0,0,0,.075)");
					}
					if (phone == '') {
						$("#phone").css("border-color", "#a94442").css("box-shadow",
							"inset 0 1px 1px rgba(0,0,0,.075)");
					}
					if (adrs == '') {
						$("#adrs").css("border-color", "#a94442").css("box-shadow",
							"inset 0 1px 1px rgba(0,0,0,.075)");
					}
					if (email == '') {
						$("#email").css("border-color", "#a94442").css("box-shadow",
							"inset 0 1px 1px rgba(0,0,0,.075)");
					}
					alert("修改信息不能为空！");
					return;
				}
				if (sex != '男' && sex != '女') {
					alert("性别只能为男或女！");
					return false;
				}
				//手机格式验证
				var telStr = /^[1]([3-9])[0-9]{9}$/;
				if (!(telStr.test(phone))) {
					alert("手机格式不规范！");
					$("#phone").css("border-color", "#a94442").css("box-shadow",
						"inset 0 1px 1px rgba(0,0,0,.075)");
					return;
				}
				//邮箱验证
				var yx = /^[a-zA-Z0-9_.-]+@[a-zA-Z0-9-]+(\.[a-zA-Z0-9-]+)*\.[a-zA-Z0-9]{2,6}$/;
				if (!(yx.test(email))) {
					alert("邮箱格式不规范！");
					$("#email").css("border-color", "#a94442").css("box-shadow",
						"inset 0 1px 1px rgba(0,0,0,.075)");
					return;
				}
	
				var formData = new FormData();
				formData.append("sex", sex);
				formData.append("phone", phone);
				formData.append("email", email);
				formData.append("username", user);
				formData.append("adrs", adrs);
				formData.append("borndate", born);
				let f = document.getElementById('file-txz');
				let f1 = f.files[0];
				// 判断是否选择上传图片
				if ($("#file-txz").val() == '') {
					//不上传	
					$.post('http://localhost:80/ct/upadmin2', {
						"sex": sex,
						"phone": phone,
						"email": email,
						"username": user,
						"adrs": adrs,
						"borndate": born
					}, function(r) {
						if (r) {
							alert("修改成功！");
						} else {
							alert("修改失败！");
						}
						location.href = 'adminpetbrand.html';
					}, "json");
				} else {
					formData.append("files", f1);
					$.ajax({
						url: 'http://localhost:80/ct/upadmin1',
						type: 'post',
						data: formData,
						contentType: false,
						processData: false,
						success: function(res) {
							if (res) {
								alert("修改成功！");
							} else {
								alert("修改失败！");
							}
							location.href = 'adminpetbrand.html';
						}
					})
				}
	
			})
	
		})
	</script>
	
	<!-- 图片上传预览 -->
	<script type="text/javascript">
		var upload = function(c, d) {
			"use strict";
			var $c = document.querySelector(c),
				$d = document.querySelector(d),
				file = $c.files[0],
				reader = new FileReader();
			reader.readAsDataURL(file);
			reader.onload = function(e) {
				$d.setAttribute("src", e.target.result);
			};
		};
	</script>
	<!-- 点击换页 -->
	<script>
		$(function() {
			$(".pagination li").click(function() {
				$(this).children("a").css("color", "#fff");
				$(this).children("a").css("cursor", "default");
				$(this).children("a").css("background-color", "#0c8687");
				$(this).children("a").css("border-color", "#0c8687");
				$(this).siblings().children("a").css("color", "#bbb");
				$(this).siblings().children("a").css("cursor", "default");
				$(this).siblings().children("a").css("background-color", "#fff");
				$(this).siblings().children("a").css("border-color", "#ddd");

			})
		})
	</script>
	<!-- 评分 -->
	<script>
		$(function() {
			$(".score").blur(function() {
				let width = $(this).val();

				if (width > 100) {
					alert("评分不能超过100!");
					return;
				}
				if (width < 0) {
					alert("评分不能低于0!");
					return;
				}
				$(this).next().children().attr("style", "width:" + width + "%");
			})
		})
	</script>

	<!-- 品种信息 -->
	<script type="text/javascript">
		$(function() {
				let index = 1;
				let pages = 1;
				$(".cxpet").click(function() {
						index = 1;
						$("#pagenum").val(index);
						petinfo();
					})
				$("#prevpage").click(function() {
						if (index > 1) {
							index = index - 1;
						} else {
							alert("当前页已是第一页！");
							index = index;
						}
						$("#pagenum").val(index);
						petinfo();
					})
				$("#nextpage").click(function() {
						if (index < pages) {
							index = index + 1;
						} else {
							alert("当前页已是最后一页！");
							index = index;
						}
						$("#pagenum").val(index);
						petinfo();
					})
				$("#lastpage").click(function() {
						index = pages;
						$("#pagenum").val(index);
						petinfo();
					})
				$("#firstpage").click(function() {
						index = 1;
						$("#pagenum").val(index);
						petinfo();
					})
				$("#go-page").click(function() {
						let pagenum = $("#pagenum").val();
						if (pagenum > pages) {
							alert("输入页码不能大于总页数！");
							index = index;
						} else {
							if (pagenum <= 0) {
								alert("输入页码不能小于1！");
								index = index;
							} else {
								index = pagenum;
							}
						}
						$("#pagenum").val(index);
						petinfo();
					})
				$("#pettype").change(function() {
						index = 1;
						$("#pagenum").val(index);
						petinfo();
					})
				petinfo();

				function petinfo() {
						$.post('http://localhost:80/ct/petdesc', {
							"index": index,
							"type": $("#pettype").val(),
							"bname": $(".bname").val()
						}, function(r) {
							console.log(r);
							$(".petinfo").children().remove();
							$(r.records).each(function(i, e) {

								let trs = "<tr>" +
									"<td>" + e.bid + "</td>" +
									"<td><img src='../images/" + e.bfile +
									"' width='45px' height='45px'/></td>" +
									"<td>" + e.bname + "</td>" +
									"<td>" + e.nickname + "</td>" +
									"<td>" + e.origin + "</td>" +
									"<td>" + e.life + "</td>" +
									"<td>" + (e.btype == 1 ? '猫' : '狗') + "</td>" +
									"<td style='width: 230px;'>" +
									"<button class='btn btn-info btn-sm' data-toggle='modal' onclick='lookscore(" +
									e.bid + ")' data-target='#myModal5'>查看</button>" +
									"<button class='btn btn-success btn-sm' onclick='sendinfo("+e.bid+")' data-toggle='modal' data-target='#myModal6'>添加</button>" +
									"</td>" +
									"<td>" +
									"<button class='btn btn-info btn-sm' data-toggle='modal' onclick='lookpetinfo(" +
									e.bid + ")' data-target='#myModal4'>详情</button>" +
									"<button class='btn btn-danger btn-sm deladmin' onclick='delpetinfo("+e.bid+")'>删除</button>" +
									"</td>" +
									"</tr>";
								$(".petinfo").append(trs);
							})
							pages = r.pages;
						}, "json");
			}

				//添加品种
				$(".addpet").click(function() {
						let bname = $("#pzmc").val();
						let nick = $("#nick").val();
						let mc = $("#mc").val();
						let ycd = $("#ycd").val();
						let tx = $("#tx").val();
						let sg = $("#sg").val();
						let tz = $("#tz").val();
						let sm = $("#sm").val();
						let iq = $("#iq").val();
						let type = $("#types1").val();
						//非空验证
						if (bname == '' || nick == '' || mc == '' || ycd == '' || tx == '' || sg == '' || tz == '' ||
							sm == '' || iq == '' || type == '0') {
							alert("添加信息不能为空！");
							return;
						}

						var formData = new FormData();
						formData.append("bname", bname);
						formData.append("nick", nick);
						formData.append("mc", mc);
						formData.append("ycd", ycd);
						formData.append("tx", tx);
						formData.append("sg", sg);
						formData.append("tz", tz);
						formData.append("sm", sm);
						formData.append("iq", iq);
						formData.append("type", type);
						let f = document.getElementById('file-tj');
						let f1 = f.files[0];
						// 判断是否选择上传图片
						if ($("#file-tj").val() == '') {
							//不上传	
							$.post('http://localhost:80/ct/addpetinfo2', {
								"bname": bname,
								"nick": nick,
								"mc": mc,
								"ycd": ycd,
								"tx": tx,
								"sg": sg,
								"tz": tz,
								"sm": sm,
								"iq": iq,
								"type": type
							}, function(r) {
								if (r) {
									alert("添加成功！");
								} else {
									alert("添加失败！");
								}
								location.href = 'adminpetbrand.html';
							}, "json");
						} else {
							formData.append("files", f1);
							$.ajax({
								url: 'http://localhost:80/ct/addpetinfo1',
								type: 'post',
								data: formData,
								contentType: false,
								processData: false,
								success: function(res) {
									if (res) {
										alert("添加成功！");
									} else {
										alert("添加失败！");
									}
									location.href = 'adminpetbrand.html';
								}
							})
						}
					})

				//添加评分
				$(".addscore").click(function() {
						let bid = $(this).attr("bid");		
						if($("#nr1").val() == ''||$("#xj1").val() == ''||$("#ys1").val() == ''||$("#mr1").val() == ''||$("#tw1").val() == ''||$("#ks1").val() == ''||$("#kx1").val() == ''||$("#hd1").val() == ''||$("#dm1").val() == ''){
							alert('评分信息不能为空！');
							return;
						}else{
							yzscore(bid);
						}	
				}) 
			    //验证是否已有评分
				function yzscore(id){
					 $.post('http://localhost:80/ct/yzscore', {"bid":id}, function(r) {		
						 if(r){
							 if(confirm("检测到该宠物品种已有评分，是否重新添加？")){	
								 //删除原有评分
								 delscore(id);
							 }
						 }else{
							//未评分直接添加评分
							addscore(id);
						 }
					 }, "json");
				}	 
				//删除原有评分
				function delscore(id){
					$.post('http://localhost:80/ct/delscore', {"bid": id},function(r){
						if(r){	
							//删除成功后添加评分
							addscore(id);
						}else{
							alert("删除失败！");
						}
					},"json");
				}
				//添加评分
				function addscore(id){
					$.post('http://localhost:80/ct/addscore',{"bid":id,"nr":$("#nr1").val(),"xj":$("#xj1").val(),"ys":$("#ys1").val(),"mr":$("#mr1").val(),"tw":$("#tw1").val(),"ks":$("#ks1").val(),"kx":$("#kx1").val(),"hy":$("#hd1").val(),"dm":$("#dm1").val()},function(r){
						if(r){
							alert("添加成功！");
						}else{
							alert("添加失败！");
						}
						location.href='adminpetbrand.html';
					},"json");	
				}					
		       //修改评分
			   $(".updatescore").click(function(){
				   if($("#nr").val() == ''||$("#xj").val() == ''||$("#ys").val() == ''||$("#mr").val() == ''||$("#tw").val() == ''||$("#ks").val() == ''||$("#kx").val() == ''||$("#hd").val() == ''||$("#dm").val() == ''){
				   	alert('评分信息不能为空！');
				   	return;
				   }else{
				   	$.post('http://localhost:80/ct/upscore',{"bid":$(".updatescore").attr("bid"),"nr":$("#nr").val(),"xj":$("#xj").val(),"ys":$("#ys").val(),"mr":$("#mr").val(),"tw":$("#tw").val(),"ks":$("#ks").val(),"kx":$("#kx").val(),"hy":$("#hy").val(),"dm":$("#dm").val()},function(r){
						if(r){
							alert("修改成功!");
						}else{
							alert("修改失败!");
						}
						location.href='adminpetbrand.html';
					},"json");
				   }	
			   })
		
		       //修改品种信息		   
			   $(".updatepetpz").click(function(){
				   let bid = $(".updatepetpz").attr("bid");
				   let bname = $("#bname1").val();
				   let nick = $("#nick1").val();
				   let mc = $("#mc1").val();
				   let ycd = $("#ycd1").val();
				   let tx = $("#tx1").val();
				   let sg = $("#sg1").val();
				   let tz = $("#tz1").val();
				   let sm = $("#sm1").val();
				   let iq = $("#iq1").val();
				   let type = $("#types2").val();
				   //非空验证
				   if (bname == '' || nick == '' || mc == '' || ycd == '' || tx == '' || sg == '' || tz == '' ||
				   	sm == '' || iq == '' || type == '0') {
				   	alert("修改信息不能为空！");
				   	return;
				   }				   
				   var formData = new FormData();
				   formData.append("bid", bid);
				   formData.append("bname", bname);
				   formData.append("nick", nick);
				   formData.append("mc", mc);
				   formData.append("ycd", ycd);
				   formData.append("tx", tx);
				   formData.append("sg", sg);
				   formData.append("tz", tz);
				   formData.append("sm", sm);
				   formData.append("iq", iq);
				   formData.append("type", type);
				   let f = document.getElementById('file-xgpz');
				   let f1 = f.files[0];
				   // 判断是否选择上传图片
				   if ($("#file-xgpz").val() == '') {
				   	//不上传	
				   	$.post('http://localhost:80/ct/uppetinfo2', {
				   		"bname": bname,
				   		"nick": nick,
				   		"mc": mc,
				   		"ycd": ycd,
				   		"tx": tx,
				   		"sg": sg,
				   		"tz": tz,
				   		"sm": sm,
				   		"iq": iq,
				   		"type": type,
						"bid":bid
				   	}, function(r) {
				   		if (r) {
				   			alert("修改成功！");
				   		} else {
				   			alert("修改失败！");
				   		}
				   		location.href = 'adminpetbrand.html';
				   	}, "json");
				   } else {
				   	formData.append("files", f1);
				   	$.ajax({
				   		url: 'http://localhost:80/ct/uppetinfo1',
				   		type: 'post',
				   		data: formData,
				   		contentType: false,
				   		processData: false,
				   		success: function(res) {
				   			if (res) {
				   				alert("修改成功！");
				   			} else {
				   				alert("修改失败！");
				   			}
				   			location.href = 'adminpetbrand.html';
				   		}
				   	})
				   }
			   })
		
		})
				//查看评分
				function lookscore(id) {
					//验证评分有无
					$.post('http://localhost:80/ct/yzscore', {
						"bid": id
					}, function(r) {
						if (r) {
							$(".updatescore").attr("disabled",false);
							$(".wpf").css("display", "none");
							//评分显示
							$.post('http://localhost:80/ct/lookscore', {"bid": id}, function(r) {
								$(".updatescore").attr("bid",id);
								$("#nr").val(r.sticky);
								$("#nr").next().children().css("width", r.sticky + "%");
								$("#xj").val(r.yell);
								$("#xj").next().children().css("width", r.yell + "%");
								$("#ys").val(r.friendly);
								$("#ys").next().children().css("width", r.friendly + "%");
								$("#dm").val(r.hairloss);
								$("#dm").next().children().css("width", r.hairloss + "%");
								$("#tw").val(r.odor);
								$("#tw").next().children().css("width", r.odor + "%");
								$("#mr").val(r.beauty);
								$("#mr").next().children().css("width", r.beauty + "%");
								$("#ks").val(r.spit);
								$("#ks").next().children().css("width", r.spit + "%");
								$("#kx").val(r.teachable);
								$("#kx").next().children().css("width", r.teachable + "%");
								$("#hy").val(r.active);
								$("#hy").next().children().css("width", r.active + "%");
							}, "json");
						
						} else {
							$(".wpf").css("display", "inline");
							$(".updatescore").attr("disabled",true);
						}
					}, "json");
				}
	
	            //传递bid
				function sendinfo(id){
					$(".addscore").attr("bid",id);
				}	   
			    //查看品种详情					
				function lookpetinfo(id){
					$.post('http://localhost:80/ct/petinfoOne', {"bid": id}, function(r) {
						$("#img-xgpz").attr("src","../images/"+r.bfile+"");
						$("#types2").val(r.btype);
						$("#bname1").val(r.bname);
						$("#nick1").val(r.nickname);
						$("#ycd1").val(r.origin);
						$("#mc1").val(r.hairlen);
						$("#tx1").val(r.shape);
						$("#sg1").val(r.weight);
						$("#tz1").val(r.height);
						$("#sm1").val(r.life);
						$("#iq1").val(r.iq);
						$(".updatepetpz").attr("bid",r.bid);
					}, "json");
											
				}
	
	            //删除单个品种					
				function delpetinfo(id){
					if(!confirm("是否确定删除该宠物品种？"))
					return;
					$.post('http://localhost:80/ct/delpetinfo', {"bid": id},function(r){
						if(r){
							alert("删除成功！");
						}else{
							alert("删除失败！");
						}
						location.href='adminpetbrand.html';
					},"json");
				}
	</script>
</html>